const qs = require('qs');
// import { parse } from 'qs';
const mockjs = require('mockjs');

module.exports = {
	'GET /profileindex/getlifecycleusercount' (req, res) {

		const data = mockjs.mock({
			data: [{
				"name": "微信粉丝",
				"value": "608"
			}, {
				"name": "微信沉睡用户",
				"value": "551"
			}, {
				"name": "微信潜在用户",
				"value": "133"
			}]
		});

		res.json({
			success: true,
			data: data.data
		})
	},

	'GET /api/useruv' (req, res) {

		const data = mockjs.mock({
			data: [{
				"time": "2016.10.21",
				"increaseCount": 0,
				"count": 1307
			}, {
				"time": "2016.10.21",
				"increaseCount": 1,
				"count": 1306
			}, {
				"time": "2016.10.21",
				"increaseCount": 1,
				"count": 1305
			}, {
				"time": "2016.10.21",
				"increaseCount": 0,
				"count": 1305
			}, {
				"time": "2016.10.21",
				"increaseCount": 0,
				"count": 1305
			}, {
				"time": "2016.10.21",
				"increaseCount": 1,
				"count": 1304
			}, {
				"time": "2016.10.21",
				"increaseCount": 3,
				"count": 1301
			}, {
				"time": "2016.10.21",
				"increaseCount": 1,
				"count": 1300
			}, {
				"time": "2016.10.21",
				"increaseCount": 2,
				"count": 1298
			}, {
				"time": "2016.10.21",
				"increaseCount": 0,
				"count": 1298
			}, {
				"time": "2016.10.21",
				"increaseCount": 0,
				"count": 1298
			}, {
				"time": "2016.10.21",
				"increaseCount": 0,
				"count": 1298
			}, {
				"time": "2016.10.21",
				"increaseCount": 1,
				"count": 1297
			}, {
				"time": "2016.10.21",
				"increaseCount": 0,
				"count": 1297
			}, {
				"time": "2016.10.21",
				"increaseCount": 1,
				"count": 1296
			}, {
				"time": "2016.10.21",
				"increaseCount": 2,
				"count": 1294
			}, {
				"time": "2016.10.21",
				"increaseCount": 2,
				"count": 1292
			}, {
				"time": "2016.10.20",
				"increaseCount": 1,
				"count": 1291
			}, {
				"time": "2016.10.20",
				"increaseCount": 5,
				"count": 1286
			}, {
				"time": "2016.10.20",
				"increaseCount": 1,
				"count": 1285
			}, {
				"time": "2016.10.20",
				"increaseCount": 2,
				"count": 1283
			}, {
				"time": "2016.10.20",
				"increaseCount": 2,
				"count": 1281
			}, {
				"time": "2016.10.20",
				"increaseCount": 1,
				"count": 1280
			}, {
				"time": "2016.10.20",
				"increaseCount": 0,
				"count": 1280
			}]
		});

		res.json({
			success: true,
			data: data.data
		})
	},

	'GET /api/memberLevelQuery' (req, res) {

		const data = mockjs.mock({
			data: [
				{
					name:'VVIP会员(黑金卡)',
					total:123
				},
				{
					name:'VIP会员(白金卡)',
					total:123
				},
				{
					name:'普通会员(金卡)',
					total:123
				},
				{
					name:'潜在会员(银卡)',
					total:123
				}
			]
		});

		res.json({
			success: true,
			data: data.data
		})
	},

	'GET /DataApi/getCount' (req, res) {

		const data = mockjs.mock({
			data: {
				"openIdCount": 86594,
				"userCount": 979136,
				"poneCount": 897664
			}
		});

		res.json({
			success: true,
			data: data.data
		})
	},

	'GET /DataApi/getUseCount' (req, res) {

		const data = mockjs.mock({
			data: {
				"unpurachasePct": 0.33,
				"posTmall": 0.56,
				"PosTmallValue": 5035,
				"PosValue": 247283,
				"MEMBERNOORDERRATE": 42.35,
				"purchase": 894691,
				"PosPct": 27.55,
				"Unpurchase": 2973,
				"MEMBERNOORDERNUM": 380139,
				"TmallValue": 262234,
				"TmallPct": 29.21,
				"PosTmallPct": 0.56
			}
		});

		res.json({
			success: true,
			data: data.data
		})
	},

	'GET /DataApi/getPhoneRegisterOrNoRegister' (req, res) {

		const data = mockjs.mock({
			data: {
				"register_phone": 5122,
				"unregister_phone": 81472,
				"registepct": 5.91,
				"unregisterpct": 94.09
			}
		});

		res.json({
			success: true,
			data: data.data
		})
	},

	'GET /DataApi/getUserAssetCount' (req, res) {

		const data = mockjs.mock({
			data: {
				"PTValueList": [898, 2429, 2589, 2596, 2603, 2605, 2608, 2616, 2619, 2626, 2628, 2632, 2640, 2642, 2657, 2664, 2673, 2677, 2687, 2697, 2702, 2702, 4987, 4994, 5004, 5012, 5018, 5026, 5035, 5042],
				"WOpendIdValueList": [81754, 81790, 81832, 81919, 81969, 82015, 82065, 82120, 82161, 82204, 82256, 82286, 82315, 82315, 82315, 82445, 82455, 82516, 82588, 82644, 82697, 82735, 82774, 82816, 82862, 82915, 83912, 85832, 86594, 86691],
				"PValueList": [240602, 239578, 240039, 240637, 241198, 241757, 242207, 242628, 243017, 243454, 243726, 244015, 244273, 244503, 244847, 245104, 245467, 246015, 246488, 246820, 247081, 247081, 245063, 245418, 245934, 246432, 246720, 247017, 247283, 247571],
				"dayIdList": ["2016-09-28", "2016-09-29", "2016-09-30", "2016-10-01", "2016-10-02", "2016-10-03", "2016-10-04", "2016-10-05", "2016-10-06", "2016-10-07", "2016-10-08", "2016-10-09", "2016-10-10", "2016-10-11", "2016-10-12", "2016-10-13", "2016-10-14", "2016-10-15", "2016-10-16", "2016-10-17", "2016-10-18", "2016-10-19", "2016-10-20", "2016-10-21", "2016-10-22", "2016-10-23", "2016-10-24", "2016-10-25", "2016-10-26", "2016-10-27"],
				"UCValueList": [605977, 609901, 611422, 612379, 613313, 614313, 615156, 616069, 616939, 617833, 618650, 619449, 620122, 621188, 622701, 623557, 624430, 625537, 626488, 627278, 628076, 628094, 970971, 971692, 972689, 973587, 975202, 977750, 979136, 979838],
				"ReNoPurValueList": [2033, 2058, 2077, 2145, 2185, 2217, 2250, 2284, 2311, 2343, 2377, 2395, 2413, 2413, 2413, 2513, 2523, 2590, 2651, 2687, 2719, 2749, 2775, 2805, 2857, 2901, 2930, 2954, 2973, 3000],
				"WNoReValueList": [78246, 78240, 78230, 78197, 78173, 78163, 78153, 78146, 78141, 78135, 78125, 78122, 78119, 78119, 78119, 78088, 78088, 78041, 78002, 77994, 77990, 77978, 77976, 77972, 77937, 77928, 78867, 80743, 81472, 81532],
				"TValueList": [49373, 53364, 54712, 55053, 55432, 55864, 56244, 56718, 57177, 57628, 58155, 58648, 59044, 59856, 60904, 61392, 62042, 62581, 63031, 63464, 63946, 63946, 259999, 260328, 260807, 261164, 261520, 261864, 262234, 262571],
				"telValueList": [527731, 531661, 533192, 534182, 535140, 536150, 537003, 537923, 538798, 539698, 540525, 541327, 542003, 543069, 544582, 545469, 546342, 547496, 548486, 549284, 550086, 550116, 892995, 893720, 894752, 895659, 896335, 897007, 897664, 898306],
				"WRValueList": [3508, 3550, 3602, 3722, 3796, 3852, 3912, 3974, 4020, 4069, 4131, 4164, 4196, 4196, 4196, 4357, 4367, 4475, 4586, 4650, 4707, 4757, 4798, 4844, 4925, 4987, 5045, 5089, 5122, 5159]
			}
		});

		res.json({
			success: true,
			data: data.data
		})
	},

	'GET /DataApi/getUserPurByYearAndChanel' (req, res) {

		const data = mockjs.mock({
			data: {
				"PTValueList": [0, 0, 0, 5042],
				"PValueList": [7, 54651, 151568, 247571],
				"yearIdList": ["2013", "2014", "2015", "2016"],
				"TValueList": [0, 0, 0, 262571]
			}
		});

		res.json({
			success: true,
			data: data.data
		})
	},

	'GET /DataApi/getAllConditionCount' (req, res) {

		const data = mockjs.mock({
			data: {
				"phonewbMatchNum": 0,
				"openIdCount": 88285,
				"PXXmatchrate": "0.58",
				"PXPmatchrate": "6.05",
				"WXWmatchrate": "0.00",
				"wbwxMatchNum": 0,
				"PWPmatchrate": "0.00",
				"wbUidCount": 0,
				"phonewxMatchNum": 5340,
				"WXXmatchrate": "0.00",
				"phoneCount": 917028,
				"PWWmatchrate": "0.00"
			}
		});

		res.json({
			success: true,
			data: data.data
		})
	},

	'GET /DataApi/getMatchCount' (req, res) {

		const data = mockjs.mock({
			data: {
				"TelWebUidValue": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
				"WeChatAndWebUidValue": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
				"TelWeChatValue": [3722, 3796, 3852, 3912, 3974, 4020, 4069, 4131, 4164, 4196, 4196, 4196, 4357, 4367, 4475, 4586, 4650, 4707, 4757, 4798, 4844, 4925, 4987, 5045, 5089, 5122, 5159, 5195, 5260, 5340],
				"dayId": ["2016-10-01", "2016-10-02", "2016-10-03", "2016-10-04", "2016-10-05", "2016-10-06", "2016-10-07", "2016-10-08", "2016-10-09", "2016-10-10", "2016-10-11", "2016-10-12", "2016-10-13", "2016-10-14", "2016-10-15", "2016-10-16", "2016-10-17", "2016-10-18", "2016-10-19", "2016-10-20", "2016-10-21", "2016-10-22", "2016-10-23", "2016-10-24", "2016-10-25", "2016-10-26", "2016-10-27", "2016-10-28", "2016-10-29", "2016-10-30"]
			}
		});

		res.json({
			success: true,
			data: data.data
		})
	},

	'GET /api/userGroupQuery' (req, res) {

		const data = mockjs.mock({
			data: [{
		      key: '1',
		      name: 'John Brown',
		      money: '￥300,000.00',
		      address: 'New York No. 1 Lake Park',
		    }, {
		      key: '2',
		      name: 'Jim Green',
		      money: '￥1,256,000.00',
		      address: 'London No. 1 Lake Park',
		    }, {
		      key: '3',
		      name: 'Joe Black',
		      money: '￥120,000.00',
		      address: 'Sidney No. 1 Lake Park',
		    }]
		});

		res.json({
			success: true,
			data: data.data
		})
	},

	'GET /api/groupTabQuery' (req, res) {
		const page = qs.parse(req.query);
		const data = mockjs.mock({
			total: 32125,
			size: 5,
			page: parseInt(req.query && req.query.page || 2),
			data: [{
		      key: '1',
		      name: '蜜丝佛陀特别组',
		      date: '20160826',
		      condition: '性别：男&星座：白羊座/双子座&活跃度：0.5-0.8',
		      connect:'手机号',
		      total:'123',
		      opration:''
		    },{
		      key: '2',
		      name: '蜜丝佛陀特别组',
		      date: '20160826',
		      condition: '性别：男&星座：白羊座/双子座&活跃度：0.5-0.8',
		      connect:'手机号',
		      total:'123',
		      opration:''
		    }, {
		      key: '3',
		      name: '蜜丝佛陀特别组',
		      date: '20160826',
		      condition: '性别：男&星座：白羊座/双子座&活跃度：0.5-0.8',
		      connect:'手机号',
		      total:'123',
		      opration:''
		    }, {
		      key: '4',
		      name: '蜜丝佛陀特别组',
		      date: '20160826',
		      condition: '性别：男&星座：白羊座/双子座&活跃度：0.5-0.8',
		      connect:'手机号',
		      total:'123',
		      opration:''
		    }, {
		      key: '5',
		      name: '蜜丝佛陀特别组',
		      date: '20160826',
		      condition: '性别：男&星座：白羊座/双子座&活跃度：0.5-0.8',
		      connect:'手机号',
		      total:'123',
		      opration:''
		    }, {
		      key: '6',
		      name: '蜜丝佛陀特别组',
		      date: '20160826',
		      condition: '性别：男&星座：白羊座/双子座&活跃度：0.5-0.8',
		      connect:'手机号',
		      total:'123',
		      opration:''
		    }]
		});

		res.json({
			success: true,
			data: data
		})
	},

	'GET /marsdata/singlePerson/active' (req, res) {

		const data = mockjs.mock({
			data: [{"name":"2016-11-08","value":"0.01971"},{"name":"2016-11-09","value":"0.01807"},{"name":"2016-11-10","value":"0.01728"},{"name":"2016-11-11","value":"0.01653"},{"name":"2016-11-12","value":"0.01582"},{"name":"2016-11-13","value":"0.01513"},{"name":"2016-11-14","value":0}]
		});

		res.json({
			success: true,
			data: data.data
		})
	},
}

